From b8b690eb88db034b606e51cff64741557a72fc86 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 28 Jul 2025 13:38:51 +0200 Subject: [PATCH] network: Clear connectivity queue after portal login When full connectivity (or rather, non-portal connectivity) is achieved, we can clear all active portal helpers. Normally, the portal helper will signal that it is done, but it is implemented in a racy manner. So here let's do a comprehensive big hammer solution to guarantee the portal helper definitely gets eventually closed even if we miss the race window in the portal helper. (The race is: the portal helper checks connectivity status either immediately or within a certain amount of time after a navigation policy decision. This could theoretically be too soon, and if missed, it won't be rescheduled.) Part-of: --- js/ui/status/network.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 36627ca03..466ec615c 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -2209,6 +2209,9 @@ class Indicator extends SystemIndicator { return; } + if (Main.sessionMode.isGreeter) + return; + let isPortal = this._client.connectivity === NM.ConnectivityState.PORTAL; // For testing, allow interpreting any value != FULL as PORTAL, because // LIMITED (no upstream route after the default gateway) is easy to obtain @@ -2217,12 +2220,14 @@ class Indicator extends SystemIndicator { // (but in general we should only prompt a portal if we know there is a portal) if (GLib.getenv('GNOME_SHELL_CONNECTIVITY_TEST') != null) isPortal ||= this._client.connectivity < NM.ConnectivityState.FULL; - if (!isPortal || Main.sessionMode.isGreeter) - return; - this._portalHandler.addConnection( - this._mainConnection.get_id(), - this._mainConnection.get_path()); + if (isPortal) { + this._portalHandler.addConnection( + this._mainConnection.get_id(), + this._mainConnection.get_path()); + } else { + this._portalHandler.clear(); + } } _updateIcon() { -- 2.39.5